<?Lassoscript
// Last modified 9/28/08 by ECL, Landmann InterActive

// NOTE: Optional parameter "Quiet" is not finished.

// Tagname			Debug
// Description		Creates a debug container
// Author			Eric Landmann
// Date				6/23/2008
// Usage			Debug;
//						'SomeVar = ' $SomeVar '<br>\n';
//					/Debug;
// Expected Output	If $svDebug = Y, contents of debug container will be output
//					If $svDebug != Y, nothing will output
If: !(Lasso_TagExists:'Debug');
	Define_Tag: 'Debug',
		-Optional='Quiet',
		-Container;

		Local('Output') = string;

		Local('Start') = ('<p class="debug"><strong>' + (Response_Filepath) + '</strong><br>\n');
		Local('End') = '</p>\n';
		If: (Var:'svDebug') == 'Y';
			#Output = (#Start) + (Run_Children) + (#End);
		Else;
			// Output nothing
		/If;
		Return: (Encode_Smart:#Output);

	/Define_Tag;

	Log_Critical: 'Custom Tag Loaded - Debug';

/If;

/*
// Testing
Var:'svDebug' = 'Y';
Var:'SomeVar' = 'booha';

Debug;
	'SomeVar = ' $SomeVar '<br>\n';
/Debug;
*/
?>
